#-------------------------------------------------------------------------------
# Name:        Tile
# Purpose:
#
# Author:      Michael Blackwood
#
# Created:     27/04/2013
# Copyright:   (c) Monxcleyr Productions 2013
# Licence:     GPL v3
#-------------------------------------------------------------------------------
#!/usr/bin/env python

import pygame

class Tile():

  """A collision tile"""

  def __init__(self, pos, size, parent):
    self.attributes = {}
    self.attributes['pos'] = pos
    self.attributes['size'] = size
    self.attributes['parent'] = parent


  def getRect(self):
    """ Returns a rect used for SAT collisions based off position of parent. """

    x = self.attributes['pos'][0] + self.attributes['parent'].attributes['pos'][0]
    y = self.attributes['pos'][1] + self.attributes['parent'].attributes['pos'][1]


    return pygame.Rect((x,y), self.attributes['size'])

